<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('设备管理表列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>设备名称：</label>
                                <input type="text" name="dev_name"/>
                            </li>
                            <!--  
                            <li>
                                <label>规格型号：</label>
                                <input type="text" name="dev_ggxh"/>
                            </li>
                            <li>
                                <label>生产厂家：</label>
                                <input type="text" name="dev_sccj"/>
                            </li>
                            <li>
                                <label>出厂日期：</label>
                                <input type="text" class="time-input" placeholder="请选择出厂日期" name="dev_ccrq"/>
                            </li>
                            <li>
                                <label>精度等级：</label>
                                <input type="text" name="dev_jddj"/>
                            </li>
                            <li>
                                <label>测量范围：</label>
                                <input type="text" name="dev_clfw"/>
                            </li>
                            <li>
                                <label>ABC分类：</label>
                                <select name="dev_abcfl" th:with="type=${@dict.getType('abc_fl')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>仪表编号：</label>
                                <input type="text" name="dev_ybbh"/>
                            </li>
                            <li>
                                <label>计划检定日期：</label>
                                <input type="text" class="time-input" placeholder="请选择计划检定日期" name="dev_jhjdrq"/>
                            </li>
                            <li>
                                <label>设备类型名称：</label>
                                <input type="text" name="dev_sblx_name"/>
                            </li>
                            <li>
                                <label>设备类型ID：</label>
                                <input type="text" name="dev_sblx_id"/>
                            </li>
                            <li>
                                <label>出厂编号：</label>
                                <input type="text" name="dev_ccbh"/>
                            </li>
                            <li>
                                <label>投产日期：</label>
                                <input type="text" class="time-input" placeholder="请选择投产日期" name="dev_tcrq"/>
                            </li>
                            <li>
                                <label>设备状态：</label>
                                <select name="dev_sbzt" th:with="type=${@dict.getType('sb_zt')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>安装区域ID：</label>
                                <input type="text" name="dev_azqy_id"/>
                            </li>
                            <li>
                                <label>安装点位名称1：</label>
                                <input type="text" name="dev_azdw1_name"/>
                            </li>
                            <li>
                                <label>安装点位ID1：</label>
                                <input type="text" name="dev_azdw1_id"/>
                            </li>
                            <li>
                                <label>安装点位名称2：</label>
                                <input type="text" name="dev_azdw2_name"/>
                            </li>
                            <li>
                                <label>安装点位ID2：</label>
                                <input type="text" name="dev_azdw2_id"/>
                            </li>
                            <li>
                                <label>安装点位名称3：</label>
                                <input type="text" name="dev_azdw3_name"/>
                            </li>
                            <li>
                                <label>安装点位ID3：</label>
                                <input type="text" name="dev_azdw3_id"/>
                            </li>
                            <li>
                                <label>是否检定：</label>
                                <input type="text" name="dev_isjd"/>
                            </li>
                            <li>
                                <label>是否报废：</label>
                                <input type="text" name="dev_isbf"/>
                            </li>
                            <li>
                                <label>所属单位代码：</label>
                                <input type="text" name="ssdw_dm"/>
                            </li>
                            <li>
                                <label>所属单位名称：</label>
                                <input type="text" name="ssdw_name"/>
                            </li>
                            <li>
                                <label>单位ID：</label>
                                <input type="text" name="deptId"/>
                            </li>
                            <li>
                                <label>单位名称：</label>
                                <input type="text" name="dept_name"/>
                            </li>
                            <li>
                                <label>部门ID：</label>
                                <input type="text" name="bm_id"/>
                            </li>
                            <li>
                                <label>部门名称：</label>
                                <input type="text" name="bm_name"/>
                            </li>
                            <li>
                                <label>作业区名称：</label>
                                <input type="text" name="zyq_name"/>
                            </li>
                            <li>
                                <label>点位ID：</label>
                                <input type="text" name="SourceTag"/>
                            </li>
                            <li>
                                <label>点位名称：</label>
                                <input type="text" name="Description"/>
                            </li>
                            <li>
                                <label>安装点位ID4：</label>
                                <input type="text" name="dev_azdw4_id"/>
                            </li>
                            <li>
                                <label>安装点位ID5：</label>
                                <input type="text" name="dev_azdw5_id"/>
                            </li>
                            -->
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="Gzmx_device:Gzmx_device:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="Gzmx_device:Gzmx_device:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="Gzmx_device:Gzmx_device:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="Gzmx_device:Gzmx_device:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('Gzmx_device:Gzmx_device:edit')}]];
        var removeFlag = [[${@permission.hasPermi('Gzmx_device:Gzmx_device:remove')}]];
        var dev_abcflDatas = [[${@dict.getType('abc_fl')}]];
        var dev_sbztDatas = [[${@dict.getType('sb_zt')}]];
        var prefix = ctx + "Gzmx_device/Gzmx_device";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "设备管理表",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: 'ID',
                    visible: false
                },
                {
                    field: 'dev_name',
                    title: '设备名称'
                },
                {
                    field: 'dev_ggxh',
                    title: '规格型号'
                },
                {
                    field: 'dev_sccj',
                    title: '生产厂家'
                },
                {
                    field: 'dev_ccrq',
                    title: '出厂日期'
                },
                {
                    field: 'dev_jddj',
                    title: '精度等级'
                },
                {
                    field: 'dev_clfw',
                    title: '测量范围'
                },
                {
                    field: 'dev_abcfl',
                    title: 'ABC分类',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(dev_abcflDatas, value);
                    }
                },
                {
                    field: 'dev_ybbh',
                    title: '仪表编号'
                },
                {
                    field: 'dev_jhjdrq',
                    title: '计划检定日期',
                    visible: false
                },
                {
                    field: 'dev_sblx_name',
                    title: '设备类型名称'
                },
                {
                    field: 'dev_sblx_id',
                    title: '设备类型ID',
                    visible: false
                },
                {
                    field: 'dev_ccbh',
                    title: '出厂编号'
                },
                {
                    field: 'dev_tcrq',
                    title: '投产日期'
                },
                {
                    field: 'dev_sbzt',
                    title: '设备状态',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(dev_sbztDatas, value);
                    }
                },
                {
                    field: 'dev_azqy_name',
                    title: '安装区域'
                },
                {
                    field: 'dev_azqy_id',
                    title: '安装区域ID',
                    visible: false
                },
                {
                    field: 'dev_azdw1_name',
                    title: '安装点位名称1',
                    visible: false
                },
                {
                    field: 'dev_azdw1_id',
                    title: '安装点位ID1',
                    visible: false
                },
                {
                    field: 'dev_azdw2_name',
                    title: '安装点位名称2',
                    visible: false
                },
                {
                    field: 'dev_azdw2_id',
                    title: '安装点位ID2',
                    visible: false
                },
                {
                    field: 'dev_azdw3_name',
                    title: '安装点位名称3',
                    visible: false
                },
                {
                    field: 'dev_azdw3_id',
                    title: '安装点位ID3',
                    visible: false
                },
                {
                    field: 'dev_isjd',
                    title: '是否检定',
                    visible: false
                },
                {
                    field: 'dev_isbf',
                    title: '是否报废',
                    visible: false
                },
                {
                    field: 'ssdw_dm',
                    title: '所属单位代码',
                    visible: false
                },
                {
                    field: 'ssdw_name',
                    title: '所属单位名称',
                    visible: false
                },
                {
                    field: 'deptId',
                    title: '单位ID',
                    visible: false
                },
                {
                    field: 'dept_name',
                    title: '单位名称',
                    visible: false
                },
                {
                    field: 'bm_id',
                    title: '部门ID',
                    visible: false
                },
                {
                    field: 'bm_name',
                    title: '部门名称',
                    visible: false
                },
                {
                    field: 'zyq_id',
                    title: '作业区ID',
                    visible: false
                },
                {
                    field: 'zyq_name',
                    title: '作业区名称',
                    visible: false
                },
                {
                    field: 'SourceTag',
                    title: '点位ID',
                    visible: false
                },
                {
                    field: 'Description',
                    title: '点位名称',
                    visible: false
                },
                {
                    field: 'dev_azdw4_name',
                    title: '安装点位名称4',
                    visible: false
                },
                {
                    field: 'dev_azdw4_id',
                    title: '安装点位ID4',
                    visible: false
                },
                {
                    field: 'dev_azdw5_name',
                    title: '安装点位名称5',
                    visible: false
                },
                {
                    field: 'dev_azdw5_id',
                    title: '安装点位ID5',
                    visible: false
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>